<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="/html/util.js"></script>
<script src="/html/axios.min.js"></script>
<script>
    function login(){
        axios.get("/user/login",{
            params:{
                code:$('code').value,
                pwd:$('pwd').value
            }
        }).then(e => {
            if (e.data == 'ok'){
                location.href = "/html/main.html"
            }else {
                $('loginSpan').innerHTML = '登录失败'
            }
        })
    }
</script>
<body>
<span style="color: red" id="loginSpan"></span><br>
    账号:<input type="text" id="code">
    密码:<input type="password" id="pwd"><br>
    <input type="button" value="登录" onclick="login()">
    <a href="/html/register.html">注册</a>
</body>
</html>